package com.rescue.mapper;

import com.rescue.forum.entity.ForumBoard;
import com.rescue.forum.vo.BoardVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BoardMapper {
    @Select("select * from forum_board where p_board_id = #{boardId} order by sort desc")
    List<BoardVO> getBoardByP(Integer boardId);

    void insert(ForumBoard forumBoard);

    @Delete("delete from forum_board where board_id = #{boarId}")
    void deleteByBoardId(Integer boardId);

    void update(ForumBoard forumBoard);
    @Select("select * from forum_board where board_id = #{boardId}")
    ForumBoard getById(Integer id);
}
